package com.wfcm.controller;

import com.wfcm.annotation.IgnoreSign;
import com.wfcm.annotation.IgnoreToken;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

@Controller
@RequestMapping("index")
public class TestController {

    @RequestMapping("getIp")
    @ResponseBody
    @IgnoreToken
    @IgnoreSign
    public String getIp(HttpServletRequest req){
        String remoteAddr = req.getRemoteAddr();
        String ngip = req.getHeader("X-Real_IP");
        return remoteAddr+"->"+ngip;
    }

    @RequestMapping("saveCoupons")
    @ResponseBody
    @IgnoreToken
    @IgnoreSign
    public void saveCoupons(HttpServletRequest req){

        String remoteAddr = req.getRemoteAddr();
        String ngip = req.getHeader("X-Real_IP");

    }

}
